<%-- 
    Document   : listar.jsp
    Created on : 22/09/2009, 11:42:20 AM
    Author     : Freddy
--%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>

<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <%@include file="/WEB-INF/jspf/header.jspf" %>

   

   
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Gesti&oacute;n de Garant&iacute;as Hipotecarias</title>
        </head>
        <body>
            <h1>Gesti&oacute;n de Garant&iacute;as Hipotecarias</h1>
            <h2>Lista de Garant&iacute;as Hipotecarias</h2>
            <h:messages id="messages" styleClass="messages_content" layout="table" errorClass="error" warnClass="warn" infoClass="info"/>
            <h:form>
                <h:panelGrid columns="4">
                    <h:commandButton id="btnVolver" value="Volver" action="volver"/>
                    <h:commandButton id="btnNuevo" value="Nuevo" action="#{GarantiaController.nuevaGarantiaHipotecaria}"/>
                    <h:inputText id="txtBuscar" value="#{GarantiaController.criterioHipotecario}"/>
                    <h:commandButton id="btnBuscar" value="Buscar" action="buscar"/>
                </h:panelGrid>
                <fieldset>
                    <legend>Lista de Garant&iacute;as Hipotecarias</legend>
                    <h:panelGrid columns="1">
                        <h:outputText value="Seleccione una garantía:" />
                        <h:panelGrid columns="1" rendered="true">
                            <t:dataTable id="tblGarantias" value="#{GarantiaController.garantiasHipotecarias}"
                                         var="item" rowClasses="TableRow1,TableRow2" columnClasses="TableColumn"
                                         bgcolor="#F1F1F1" border="10" cellpadding="5"
                                         cellspacing="3" first="0"
                                         frame="hsides" rules="all"
                                         styleClass="TableClass" headerClass="TableHeader" footerClass="TableFooter">
                                <h:column>
                                    <f:facet name="header"><h:outputText value="CodGar"/></f:facet>
                                    <h:outputText value="#{item.idGarantia}" />
                                </h:column>
                                <h:column>
                                    <f:facet name="header"><h:outputText value="TipoGar"/></f:facet>
                                    <h:outputText value="#{item.tipohipoteca}" />
                                </h:column>
                                <h:column>
                                    <f:facet name="header"><h:outputText value="Cliente"/></f:facet>
                                    <h:outputText value="#{item.cliente.nombrePersona} #{item.cliente.apePaternoPersona} #{item.cliente.apeMaternoPersona}" />
                                </h:column>
                                <h:column>
                                    <h:commandButton id="btnMostrar"
                                       action="#{GarantiaController.mostrar}"
                                       value="Mostrar">
                                           <f:setPropertyActionListener target="#{GarantiaController.garantiaHipotecaria}" value="#{item}" />
                                    </h:commandButton>
                                </h:column>
                                <h:column>
                                    <h:commandButton id="btnEditar"
                                       action="#{GarantiaController.editar}"
                                       value="Editar" >
                                           <f:setPropertyActionListener target="#{GarantiaController.garantiaHipotecaria}" value="#{item}" />
                                    </h:commandButton>
                                </h:column>
                                <h:column>
                                    <h:commandButton id="btnEliminar"
                                       action="#{GarantiaController.eliminarGarHipotecaria}"
                                       value="Eliminar">
                                           <f:setPropertyActionListener target="#{GarantiaController.garantiaHipotecaria}" value="#{item}" />
                                    </h:commandButton>
                                </h:column>
                            </t:dataTable>
                        </h:panelGrid>
                    </h:panelGrid>
                </fieldset>
            </h:form>
        </body>
    </html>
     <%@include file="/WEB-INF/jspf/footer.jspf" %>
</f:view>